/*
   Copyright (c) 2019 Shanghai Xuanzi Technology Co. Ltd https://xuanzi.ltd
   XZMindMap is licensed under the Mulan PSL v1.
   You can use this software according to the terms and conditions of the Mulan PSL v1.
   You may obtain a copy of Mulan PSL v1 at:
      http://license.coscl.org.cn/MulanPSL
   THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
   IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
   PURPOSE.
   See the Mulan PSL v1 for more details.

*/

package xuanzi.openmind.nodes;

public class Style {

	public Style() {
		// TODO Auto-generated constructor stub
	}

	public int textColor = -1;
	
	public int textSize = -1;
	
	public int lineColor = -1;
	
	public int borderColor = -1;
	
	public int backgroundColor = -1;
	
	public int labelBackgroundColor = -1;
	
	public float lineSize = -1;
	
	public float borderSize = -1;
	
	
	public static void extendsStyle(Style child,Style parent) {
		if(parent==null||child==null)
			return ;
		
		if(child.textColor==-1)
			child.textColor = parent.textColor;
		if(child.backgroundColor==-1)
			child.backgroundColor = parent.backgroundColor;
		if(child.labelBackgroundColor==-1)
			child.labelBackgroundColor = parent.labelBackgroundColor;
		if(child.lineColor==-1)
			child.lineColor = parent.lineColor;
		if(child.borderColor==-1)
			child.borderColor = parent.borderColor;
		if(child.lineColor==-1)
			child.lineColor = parent.lineColor;
		if(child.borderSize==-1)
			child.borderSize = parent.borderSize;
		if(child.lineSize==-1)
			child.lineSize = parent.lineSize;
		if(child.textColor==-1)
			child.textColor = parent.textColor;
		if(child.textSize==-1)
			child.textSize = parent.textSize;
	}
	
	
}
